# This file is part of BlackArch Linux ( http://blackarch.org ).
# See COPYING for license details.

pkgname=social-mapper
pkgver=190.92be8da
pkgrel=7
pkgdesc='A social media enumeration and correlation tool.'
arch=('any')
groups=('blackarch' 'blackarch-social' 'blackarch-recon')
url='https://github.com/SpiderLabs/social_mapper'
license=('GPL')
depends=('python-beautifulsoup4' 'python-selenium' 'python-pyvirtualdisplay'
         'python-tabulate' 'python-requests' 'python-face-recognition-models'
         'python-django' 'python-numpy' 'python-scipy' 'python-matplotlib'
         'python-scikit-image' 'python-scikit-learn' 'ipython' 'python-dlib'
         'python-facebook-sdk' 'python-face-recognition' 'cookiejar'
         'python-easyprocess')
makedepends=('git')
source=("$pkgname::git+https://github.com/SpiderLabs/social_mapper.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 README.md "$pkgdir/usr/share/doc/$pkgname/README"

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"

 cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python social_mapper.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

